Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move initialization to constructor #2503

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

neilenns
Copy link
Contributor

Fixes #2502

@neilenns
Copy link
Contributor Author

@DABH I moved this into the constructor based on your comment in the issue but I'm still confused about how one even sees that error. What should I be running locally before opening PRs to make sure changes are good?

@neilenns neilenns marked this pull request as draft August 13, 2024 11:58
@neilenns
Copy link
Contributor Author

Ran the console.test.js unit tests locally and confirmed they all pass with this change:

npx mocha .\test\unit\winston\transports\console.test.js

  Console transport
    ✔ { stderrLevels: ['info', 'error'] } logs to them appropriately
    ✔ { consoleWarnLevels: ['warn', 'debug'] } logs to them appropriately
    ✔ { eol } adds a custom EOL delimiter
    with defaults
      ✔ logs all levels to stdout
      ✔ should set stderrLevels to [] by default
    throws an appropriate error when
      ✔ if stderrLevels is set, but not an Array { stderrLevels: 'Not an Array' }
      ✔ if stderrLevels contains non-string elements { stderrLevels: ['good', /^invalid$/, 'valid']

  Console transport (abstract-winston-tranport)
    .log()
      ✔ should be present
{"level":"debug","message":"foo"}
      ✔ (with no callback) should return true
{"level":"debug","message":"foo"}
      ✔ (with callback) should return true
    events
{"level":"debug","message":"foo"}
      ✔ should emit the "logged" event

Also did npm run build and npm pack, then installed it in my test app using npm install ..\winston\winston-3.14.1.tgz and then ran the test app:

node ./index.js
{"level":"info","message":"Hi!"}

@neilenns neilenns marked this pull request as ready for review August 13, 2024 15:45
@DABH DABH merged commit 2458ba6 into winstonjs:master Aug 14, 2024
4 checks passed
@DABH
Copy link
Contributor

DABH commented Aug 14, 2024

v3.14.2 has been published. Thanks again all!

Vylpes pushed a commit to Vylpes/card-drop that referenced this pull request Sep 2, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [winston](https://github.com/winstonjs/winston) | dependencies | minor | [`3.13.1` -> `3.14.2`](https://renovatebot.com/diffs/npm/winston/3.13.1/3.14.2) |

---

### Release Notes

<details>
<summary>winstonjs/winston (winston)</summary>

### [`v3.14.2`](https://github.com/winstonjs/winston/releases/tag/v3.14.2)

[Compare Source](winstonjs/winston@v3.14.1...v3.14.2)

-   Move initialization to constructor ([#&#8203;2503](winstonjs/winston#2503))  [`2458ba6`](winstonjs/winston@2458ba6)

### [`v3.14.1`](https://github.com/winstonjs/winston/releases/tag/v3.14.1)

[Compare Source](winstonjs/winston@v3.14.0...v3.14.1)

-   Save a reference to console methods in console transport ([#&#8203;2498](winstonjs/winston#2498))  [`e82752f`](winstonjs/winston@e82752f)
-   Add `forceConsole` to `ConsoleTransportOptions` ([#&#8203;2496](winstonjs/winston#2496))  [`4ff0538`](winstonjs/winston@4ff0538)
-   Bump mocha from 10.6.0 to 10.7.0 ([#&#8203;2489](winstonjs/winston#2489))  [`62acaad`](winstonjs/winston@62acaad)
-   Update readme with forceConsole info ([#&#8203;2493](winstonjs/winston#2493))  [`b2b79af`](winstonjs/winston@b2b79af)

### [`v3.14.0`](https://github.com/winstonjs/winston/releases/tag/v3.14.0)

[Compare Source](winstonjs/winston@v3.13.1...v3.14.0)

-   Add option forceConsole ([#&#8203;2276](winstonjs/winston#2276))  [`b2098fd`](winstonjs/winston@b2098fd)
-   Set \_rotate false on emit 'rotate' false ([#&#8203;2457](winstonjs/winston#2457))  [`1719275`](winstonjs/winston@1719275)
-   Bump [@&#8203;babel/core](https://github.com/babel/core) from 7.24.7 to 7.24.9 ([#&#8203;2485](winstonjs/winston#2485))  [`d2859f3`](winstonjs/winston@d2859f3)
-   Bump [@&#8203;babel/preset-env](https://github.com/babel/preset-env) from 7.24.7 to 7.24.8 ([#&#8203;2487](winstonjs/winston#2487))  [`71e4bb1`](winstonjs/winston@71e4bb1)
-   fix: readme ([#&#8203;2488](winstonjs/winston#2488))  [`0cb8c7c`](winstonjs/winston@0cb8c7c)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzMS40IiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==-->

Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/352
Reviewed-by: Vylpes <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: User reports breakage with 3.14.1
2 participants